package com.youlu.campus.activity.repositories;

import com.youlu.campus.activity.entity.ActivityLotteryConfig;
import org.springframework.data.mongodb.repository.MongoRepository;

import javax.validation.constraints.NotNull;

/**
 * 活动抽奖配置
 *
 * @Description: ActivityLotteryConfigRepository
 * @Date 2025/7/31
 * @author: su
 */
public interface ActivityLotteryConfigRepository extends MongoRepository<ActivityLotteryConfig, String> {

    /**
     * 通过活动id查询
     *
     * @param activityId
     * @return
     */
    ActivityLotteryConfig findByActivityId(String activityId);

    /**
     * 通过活动id和状态查询
     *
     * @param activityId
     * @param status
     * @return
     */
    ActivityLotteryConfig findByActivityIdAndStatus(@NotNull(message = "活动id不能为空") String activityId, Integer status);
}
